package com.hisense.hisensedatacheck.runner;

import com.hisense.hisensedatacheck.service.FrXzcfxxVerifyService;
import com.hisense.hisensedatacheck.service.FrXzxkxxVerifyService;
import com.hisense.hisensedatacheck.service.ZrrXzcfxxVerifyService;
import com.hisense.hisensedatacheck.service.ZrrXzxkxxVerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

//启动项目时执行
@Component
@Order(value = 1)
public class Runner implements ApplicationRunner {
    @Autowired
    private Exit exit;
    @Autowired
    private FrXzcfxxVerifyService frXzcfxxVerify;
    @Autowired
    private FrXzxkxxVerifyService frXzxkxxVerify;
    @Autowired
    private ZrrXzcfxxVerifyService zrrXzcfxxVerify;
    @Autowired
    private ZrrXzxkxxVerifyService zrrXzxkxxVerify;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        System.out.println("开始执行法人行政许可");
        Long time=System.currentTimeMillis();
        frXzxkxxVerify.frXzxkxxVerify();
        System.out.println("法人行政许可用时："+((System.currentTimeMillis()-time)/1000)+"秒");
        time=System.currentTimeMillis();
        System.out.println("开始执行法人行政处罚");
        frXzcfxxVerify.frXzcfxxVerify();
        System.out.println("法人行政处罚用时："+((System.currentTimeMillis()-time)/1000)+"秒");
        System.out.println("开始执行自然人行政许可");
        time=System.currentTimeMillis();
        zrrXzxkxxVerify.zrrXzxkxxVerify();
        System.out.println("自然人行政许可用时："+((System.currentTimeMillis()-time)/1000)+"秒");
        System.out.println("开始执行自然人行政处罚");
        time=System.currentTimeMillis();
        zrrXzcfxxVerify.zrrXzcfxxVerify();
        System.out.println("自然人行政处罚用时："+((System.currentTimeMillis()-time)/1000)+"秒");
        exit.exit();
    }
}
